<?
include('./decode.php');
$location=$_GET['location'];
$lora= new lora();
$data=$lora->readData();
$accessData=array();
foreach($data as $arr){
    if($arr[3]==$location){
        $accessData[]=$arr;
    }
}

// var_dump($accessData);
?>

<!DOCTYPE html>
<html lang="en" class="ie_11_scroll">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="hhhwidth=device-width, initial-scale=1">
        <title>PiscesMiner Lora-region</title>
        <!-- CSS -->
        <link rel="stylesheet" href="css/bootstrap.min.css">
        <link rel="stylesheet" href="css/font-awesome.min.css">
        <link rel="stylesheet" href="css/templatemo_style.css">
        <!-- Favicon and touch icons -->
        <link rel="shortcut icon" href="favicon.png" />
        <!--[if lt IE 9]>
          <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
          <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
        <![endif]-->
    </head>
    <body>
        <!-- Features -->
        <section id="templatemo_features">
            <div class="container-fluid">
                <header class="template_header">
                    <h1 class="text-center"><span>...</span> <?
                            echo  $accessData[0][3];
                            ?>   <span>...</span></h1>
                </header>
                <div class="col-sm-12">
                    <div class="col-sm-6 col-lg-3 feature-box">
                        <div class="feature-box-inner">
                            <div class="feature-box-icon">
                                <i class="fa fa-music"></i>
                            </div>
                            <p>
                            Country Code:
                                <br>
                            <?
                            echo  $accessData[0][0];
                            ?>    
                            </p>
                        </div>
                    </div>
                    <div class="col-sm-6 col-lg-3 feature-box">
                        <div class="feature-box-inner">
                            <div class="feature-box-icon">
                                <i class="fa fa-pagelines"></i>
                            </div>
                            <p>
                            Country Name：
                                <br>
                                <?
                            echo  $accessData[0][3];
                            ?>  
                            </p>
                        </div>
                    </div>
                    <div class="col-sm-6 col-lg-3 feature-box">
                        <div class="feature-box-inner">
                            <div class="feature-box-icon">
                                <i class="fa fa-ship"></i>
                            </div>
                            <p>
                            Country Region：
                                <br>
                                <?
                            
                            if(strlen($accessData[0][4])<2){
                                $accessData[0][4]='No result!';
                            }
                            echo  $accessData[0][4];
                            ?>  
                            </p>
                        </div>
                    </div>
                    <div class="col-sm-6 col-lg-3 feature-box">
                        <div class="feature-box-inner">
                            <div class="feature-box-icon">
                                <i class="fa fa-trophy"></i>
                            </div>
                            <p>
                            Legal latitude and longitude：
                                <br>
                                latitude:
                                <br>
                                <?
                            echo  $accessData[0][2];
                            ?>  
                              <br>
                              longitude:
                              <br>
                              <?
                            echo  $accessData[0][1];
                            ?>  
                            </p>
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <!-- require plugins -->
        <script src="js/jquery.min.js"></script>
        <script src="js/jquery-ui.min.js"></script>
        <script src="js/bootstrap.min.js"></script>
        <script src="js/jquery.parallax.js"></script>
        <!-- template mo config script -->
        <script src="js/templatemo_scripts.js"></script>
    </body>
</html>